﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ThietBiSo.LinQDB;

namespace ThietBiSo.Models
{
    public class MLienHe
    {
        private _24hmuaonlineDataContext context = new _24hmuaonlineDataContext();
        public string FindAll()
        {
            var v = from f in context.LienHes select f.NoiDung;

            return v.FirstOrDefault();
        }
        public LienHe FindAll_Web()
        {
            var v = from f in context.LienHes select f;
            return v.FirstOrDefault();
        }
        public void Save(LienHe bv)
        {
            context.LienHes.InsertOnSubmit(bv);
            context.SubmitChanges();
        }
        public void Update(LienHe bv)
        {
            var v = from f in context.LienHes
                    select f;
            LienHe bvdb = v.SingleOrDefault(d => d.Id.Equals(bv.Id));

            bvdb.NoiDung = bv.NoiDung;
            context.SubmitChanges();
        }
    }
}